<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/template2.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateResponsavelTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">

            <!--<h:form prependId="false">-->
                <p:growl id="messages" life="3000"/>

                <h:panelGroup id="messagePanel" styleClass="ajustaListaMensagemErro"  layout="block">
                    <h:messages errorStyle="color: red" infoStyle="color: green" layout="list"/>
                </h:panelGroup>

                <p:panel>
                    <f:facet name="header">
                        <h:outputText value="#{bundle.LegendResponsavelTitle}"/>
                    </f:facet>
                    <h:panelGrid columns="2">                    
                        <h:outputLabel value="#{bundle.CreateResponsavelLabel_rspNm}" for="rspNm" />
                        <p:inputText id="rspNm" size="70" maxlength="100" value="#{responsavelController.selected.rspNm}" title="#{bundle.CreateResponsavelTitle_rspNm}" required="true" requiredMessage="#{bundle.CreateResponsavelRequiredMessage_rspNm}"/>                        
                        <h:outputLabel value="#{bundle.CreateResponsavelLabel_rspEmail}" for="rspEmail" />
                        <p:inputText id="rspEmail" size="70" maxlength="255" value="#{responsavelController.selected.rspEmail}" title="#{bundle.CreateResponsavelTitle_rspEmail}" >
                            <f:validator for="rspEmail" validatorId="br.gov.ana.validators.EmailValidator"/>
                        </p:inputText>
                        <h:outputLabel value="#{bundle.CreateResponsavelLabel_rspCrgId}" for="rspCrgId" />
                        <p:selectOneMenu id="rspCrgId" value="#{responsavelController.selected.rspCrgId}" >
                            <f:selectItems value="#{cargoController.itemsAvailableSelectOne}"/>
                        </p:selectOneMenu>
                        <h:outputLabel value="#{bundle.CreateResponsavelLabel_rspAreId}" for="rspAreId" />
                        <p:selectOneMenu id="rspAreId" value="#{responsavelController.selected.rspAreId}"  >
                            <f:selectItems value="#{areaController.itemsAvailableSelectOne}"/>
                        </p:selectOneMenu>
                    </h:panelGrid>
                    <br />

                    <p:commandButton ajax="false" rendered="#{!autenticadorController.loginVisualizador}" icon="#{bundle.icone_salvar}" action="#{responsavelController.create}" value="#{bundle.CreateResponsavelSaveLink}" /> &nbsp;
                    <p:commandButton ajax="false" action="#{responsavelController.prepareList}" icon="#{bundle.icone_listar}" value="#{bundle.CreateResponsavelShowAllLink}" immediate="true"/>


                </p:panel>
            <!--</h:form>-->
        </ui:define>
    </ui:composition>

</html>
